package test;

import java.util.Locale;
import java.util.ResourceBundle;

public class Application {
	public static void main(String[] args) {
		// zh_CN
		System.out.println("Current Locale: " + Locale.getDefault());
		ResourceBundle mybundle = ResourceBundle.getBundle("MyLabels");

		System.out.println("Say how are you : " + mybundle.getString("how_are_you"));
		
		// zh_CN
		System.out.println("Current Locale: " + Locale.getDefault());
		mybundle = ResourceBundle.getBundle("test.MyLabels");
		
		System.out.println("Say how are you : " + mybundle.getString("how_are_you"));
		
		// zh_CN
		System.out.println("Current Locale: " + Locale.getDefault());
		mybundle = ResourceBundle.getBundle("MyLabels");

		// read MyLabels_zh_CN.properties
	System.out.println("Say how are you in CN zhongwen: " + mybundle.getString("how_are_you"));

		
		
		System.out.println("=========================================");
		Locale.setDefault(new Locale("en_US"));// 不区分大小写

		// read MyLabels_en_US.properties
		System.out.println("Current Locale: " + Locale.getDefault());
		mybundle = ResourceBundle.getBundle("MyLabels");
		System.out.println("Say how are you in Malaysian Malaya language: " + mybundle.getString("how_are_you"));

		Locale.setDefault(new Locale("ms_MY"));

		// read MyLabels_ms_MY.properties
		System.out.println("Current Locale: " + Locale.getDefault());
		mybundle = ResourceBundle.getBundle("MyLabels");
		System.out.println("Say how are you in Malaysian Malaya language: " + mybundle.getString("how_are_you"));

	}

}
